<?php

namespace common\models\bi;

use Yii;

/**
 * This is the model class for table "HR_ORG_FLAT".
 *
 * @property string $HOF_COMPANY_ID HR公司ID
 * @property string $HOF_PARENT_ID 上级公司ID
 * @property string $HOF_ORG_LEVEL 所属层级
 * @property string $HOF_STARTDATE 开始时间
 * @property string $HOF_UPDATE 结束时间
 * @property string $HOF_CREATED_AT 创建时间
 * @property string $HOF_UPDATED_AT 最后修改时间
 */
class HrOrgFlat extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'HR_ORG_FLAT';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('db_bi');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['HOF_COMPANY_ID'], 'required'],
            [['HOF_ORG_LEVEL'], 'number'],
            [['HOF_STARTDATE', 'HOF_UPDATE', 'HOF_CREATED_AT', 'HOF_UPDATED_AT'], 'safe'],
            [['HOF_COMPANY_ID', 'HOF_PARENT_ID'], 'string', 'max' => 36],
            [['HOF_COMPANY_ID'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'HOF_COMPANY_ID' => Yii::t('app', 'Hof  Company  ID'),
            'HOF_PARENT_ID' => Yii::t('app', 'Hof  Parent  ID'),
            'HOF_ORG_LEVEL' => Yii::t('app', 'Hof  Org  Level'),
            'HOF_STARTDATE' => Yii::t('app', 'Hof  Startdate'),
            'HOF_UPDATE' => Yii::t('app', 'Hof  Update'),
            'HOF_CREATED_AT' => Yii::t('app', 'Hof  Created  At'),
            'HOF_UPDATED_AT' => Yii::t('app', 'Hof  Updated  At'),
        ];
    }
}
